const db_test = require('../config').db_test
module.exports.update_url = update_url
async function update_url(course_id, image_url, length) {
    course_id = db_test.escape(course_id);
    image_url = db_test.escape(image_url);
    let sql = 'UPDATE bus_trainning SET decode_flag=1,course_length=' + length + ',course_image=' + image_url + ' WHERE course_id=' + course_id;
    // let sql = 'UPDATE bus_trainning SET decode_flag=1 WHERE course_id=' + course_id;
    return (await db_test.queryNum(sql) == 1) ? true : false;
}